ifdef DBG
TARGET=soundengined
DEPEND=dependd.mk
else
TARGET=soundengine
DEPEND=depend.mk
endif

$(TARGET): tmp/$(DEPEND) .FORCE
	$(MAKE) -C tmp -f $(DEPEND) ../$(TARGET) TARGET=$(TARGET) DBG=$(DBG)
tmp/$(DEPEND): *.cpp *.hpp Makefile rules.mk tmp
	cd tmp && echo "SOURCES=" ../*.cpp > $(DEPEND)
	cat rules.mk >> tmp/$(DEPEND)
	cd tmp && g++ -c $(CPPFLAGS) -MM ../*.cpp >> $(DEPEND)
tmp:
	mkdir tmp
clean:
	rm -Rf tmp
	rm soundengine?
.FORCE:
